package com.chaopei.msite_web.service;

import com.chaopei.msite_web.entity.UserInfo;
import com.chaopei.msite_web.service.impl.UserServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author Corday 天涯
 * @Date 2022/4/29 15:58
 * feign远程获取另一个服务的数据
 * 要做熔断处理,防止其它服务没响应
 */
@FeignClient(value = "user-mng",fallback = UserServiceImpl.class)
public interface UserSevice {
    /**
     *  login
     * @param userName
     * @param password
     * @return false/true
     */
    @RequestMapping("/user/login")
    public String userLogin(@RequestParam("userName") String userName,@RequestParam("password") String password);
    @RequestMapping("/user/register")//此处为自定义对象
    public String userRegister(@RequestBody UserInfo userInfo);
}
